﻿
@{
    ViewBag.Title = "OrderAuditResult";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<form id="form1" class="form-horizontal">
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box-body">
                    <ul class="timeline" id="tbodylist">
                    </ul>
                    <div class="no-data" id="nodata" style="display:none;">
                        <div class="img-box"></div>
                        <div class="text">暂无数据</div>
                    </div>
                </div>
            </div>

        </div>
        <!-- /.row -->
    </section>
</form>
@section scriptsBottom{
    <script src="@Url.Content("~/lib/art-template/template-web.js")"></script>
    <script id="dataItemTpl" type="text/html">
        {{each data}}
        <li>
            <i class="fa fa-user bg-aqua"></i>
            <div class="timeline-item">
                <span class="time"><i class="fa fa-clock-o"></i> {{$value.CreatedDate}}</span>
                <h3 class="timeline-header"><a href="#">{{$value.UserName}}{{$value.AuditResultTxt}}</a>                
                </h3>
                <div class="timeline-body">
                    {{if $value.AuditResult==2}}
                    驳回原因:{{$value.RejectReason}},
                    {{/if}}
                    备注:{{$value.Remark}}
                </div>
             </div>
        </li>
        {{/each}}
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            initData();
        });

        //查询
        function initData() {
             var url = '@Url.Action("GetOperateRecordByOrderId", "Order")?orderId=@ViewBag.OrderId'
            //查询列表
            $.ajax({
                url: url,
                type: 'GET',
                dataType: "json",
                success: function (data) {
                    if (data.status == 0) {
                        $("#nodata").hide();
                        //模板渲染
                        var html = template('dataItemTpl', data);
                        var odiv = "<li><i class=\"fa fa-globe bg-aqua\"></i>"
                                   + "<div class=\"timeline-item\"><span class=\"time\"><i class=\"fa fa-clock-o\"></i> @ViewBag.OrderCreateTime</span>"
                                   + "<h3 class=\"timeline-header no-border\"><a href=\"#\">创建订单</a></h3></div></li>"
                                   + "<li><i class=\"fa fa-clock-o bg-gray\"></i> </li>";
                        document.getElementById('tbodylist').innerHTML = html + odiv;

                    } else {
                        $("#nodata").show();
                    }
                   
                }
            });
        }
    </script>
}




